package com.jiangore.entity;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author jiangtao
 * @since 2020-01-15
 */
@Data
@Builder
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "a_member")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer"})
public class Member implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 行政区划ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "account", unique = true, nullable = false, length = 64)
    private String account;

    @JsonProperty("nickName")
    private String nickname;

    private String password;

    private String email;

    @JsonAlias(value = "phone")
    private String mobile;

    private Integer age;

    @Column(name = "register_time")
    private LocalDateTime registerTime;


}
